Skip to main content

Merge individual data with job data

The script below shows how to work with job data from the A scheme. This was reviewed in our theme course, which was run twice in 2022.

This concrete example demonstrates how to connect personal data with job data. This is useful when you want to create job statistics where employment/job are used as the unit of analysis.

The variable ARBEIDSFORHOLD_PERSON is used to link the personal data to the correct employment relationship/job (the variable contains the personal identifier associated with the employment relationship/job in question).

If you would rather do the opposite and link job information on a personal data set (using person as the unit of analysis), you can use the procedure demonstrated in the example Merge job data into individual level datasets - numerical values or Merge job data into individual level datasets - categorical values.

 require no.ssb.fdb:30 as db

create-dataset jobs
import db/ARBLONN_ARB_YRKE_STYRK08 2021-07-16 as occupation
import db/ARBLONN_ARB_ARBEIDSTID 2021-07-16 as worktime
import db/ARBLONN_LONN_EKV_IALT 2021-06-30 as monthly_salary_fulltime_equiv
import db/ARBEIDSFORHOLD_PERSON as personid

create-dataset persons
import db/ARBLONN_PERS_KJOENN 2021-07-16 as gender
merge gender into jobs on personid

use jobs
tabulate occupation gender, summarize(monthly_salary_fulltime_equiv)
tabulate occupation gender, summarize(worktime)